#!/usr/bin/perl -w
use strict;
use Data::Dumper;
use Getopt::Long;

my @create_para;
my $create_para_ref = { };
my $op = undef;

GetOptions('opt=i' => \&handler,
	   'help|?' => \&help,
           #'create=s' => \@create_para,  #即每次都有一个--create来接收一个参数
           'create=s{1,5}' => \@create_para,   #--create  123 456 789这样的形式
           'start|stop=s' => \$op,
           'm=s%{0,5}' => \$create_para_ref
);


print $op."\n" if($op);
exit;

sub handler
{
   my ($opt_name,$opt_value,$names,$name_value) = @_;
   print "Option name is $opt_name and value is $opt_value\n" if($opt_name);
   print "Option name is $names and value is $name_value\n" if($names);
}

sub help
{
   print "This is a help function!\n";
}

my $status =  $create_para_ref->{'status'};
if($status){
    print "Is not NULL!\n";
}

exit;
print Dumper($create_para_ref);

foreach my $key (keys %$create_para_ref)
{
   print "$key"." -> ". "$create_para_ref->{$key}"."\n";
}



exit;
foreach my $i(@create_para){
     print $i."\n";
}
